#include <iostream>
using namespace std;
class Integer
{
private:
    int i;

public:
    Integer(int ii) : i(ii) {};
    const Integer operator+(const Integer &rv) const
    {
        cout << " operator+" << endl;
        return Integer(i + rv.i);
    }

    const Integer& operator+=(const Integer &rv) 
    {
        cout << " operator+=" << endl;
        i+=rv.i;
        return *this;
    }
    friend ostream &operator <<(ostream & os, const  Integer &r);
};

ostream &operator<<(ostream & os, const  Integer &r){
    os <<r.i <<endl;
    return os;
}
int main(){
    Integer ii(1),jj(2),kk(3);
    kk += ii+jj;
    cout << kk <<endl;
}